const initialState = {
    date:"2022/11/30",
    arr:[],
    linearr:[
        {
            wiight:"50kg",
            date:"2021-11-09",
            origin:"家庭自测"
        },
        {
            wiight:"50kg",
            date:"2021-11-09",
            origin:"家庭自测"
        }
    ]
}

let appreducer =  (state = initialState, { type, payload }) => {
    let newobj = JSON.parse(JSON.stringify(state))
  switch (type) {

  case "setDate":
      newobj.date = payload
    return newobj
  case "getdata" :
      newobj.arr = payload
      return newobj
  default:
    return state
  }
}
export default appreducer
